{# On �tend notre layout #}
{% extends "::base.html.twig" %}

{# Dans notre layout, il faut d�finir le block body #}
{% block bundleContent %}

    {% block content %}

	<!-- BEGIN CONTENT WRAPPER -->
	<div id="content-wrapper" class="content-wrapper">
		<div class="container">
			<div class="clearfix">

				<div class="grid_12">
					<div id="event" class="classiczone">
						<h3>
							Cr&eacute;ez une naissance
						</h3>
						<div class="create-description">
							Cr&eacute;er une naissance en remplissant le nom des parents et la date de terme pr&eacute;vue.<br />Vous pourrez ensuite inviter vos amis &agrave; parier sur la date.
						</div>
						
						{#<div class="bag">
							<span class="notice">
								{% for flashMessage in app.session.flashbag.get('notice') %}
									{{ flashMessage }}
								{% endfor %}
							</span>
							<span class="error_bag">
								{% for flashMessage in app.session.flashbag.get('error') %}
									{{ flashMessage }}
								{% endfor %}
							</span>
						</div>#}
						
						<form action="{{ path('bmb_event_create') }}" method="post" {{ form_enctype(form) }}>
							<div class="input-inline">
								{#<span class="input-label">{{ form_label(form.evtTitle, "Nom des parents (ex :Luc et Laura)") }}</span>#}
								{{ form_widget(form.evtTitle) }}
							</div>
							<div class="input-inline">
								{#<span class="input-label">{{ form_label(form.evtPlannedDate, "Date prévue (dd/mm/yyyy)") }}</span>#}
								{{ form_widget(form.evtPlannedDate) }}
							</div>
							<div class="input-inline">
								{#<span class="input-label">{{ form_label(form.evtPlannedDate, "Date prévue (dd/mm/yyyy)") }}</span>#}
								{{ form_widget(form.evtBirthList) }}
							</div>
							{{ form_rest(form) }}
							<div class="input-inline align-bottom">
								<button id="bmb_create_button"><i id="bmb_create_button_i" class=""></i> Cr&eacute;er</button>
							</div>
						</form>
					</div>
				</div>
			</div>
			<!-- <div class="hr"></div> -->
		</div>
	</div>
	
	<script type="text/javascript">
		$(document).ready(function() {
			$('#bmb_eventbundle_event_evtPlannedDate').datepicker({lang: 'fr', firstDay: 1, defaultDate: '{{event.evtPlannedDate|date("d/m/Y")}}'});
			$('#bmb_eventbundle_event_evtPlannedDate').datepicker("option", "dateFormat", "dd/mm/yy");
		  
			$('#bmb_create_button').click(function() {
				$('#bmb_create_button_i').attr('class', 'icon-check-sign');
				$('#bmb_create_button').attr('disabled', true);
				$('#bmb_create_button').parents('form').submit();
			});
		});
	</script>

	{% endblock %}

{% endblock %}